package com.dob.patterns;

import com.dob.model.Account;
import com.dob.model.LDAPAccount;
import com.dob.service.LDAPService;

public class LDAPAdapter {
	
	public boolean validateAccount(Account acc){
		return LDAPService.validateAccount(createLDAPAccount(acc));
	}
	
	private LDAPAccount createLDAPAccount(Account acc){
		LDAPAccount ldapAccount= new LDAPAccount();
		ldapAccount.setLdp_accNo(acc.getAccNo());
		ldapAccount.setLdp_userName(acc.getUserName());
		ldapAccount.setLdp_password(acc.getPassword());
		 return ldapAccount;
	}

}
